<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="form">
        <p><label for="">用户名:</label><input type="text" class="user"></p>
        <p><label for="">密码：</label><input type="password" class="pwd"></p>
        <p><button class="regi">注册</button><button class="sign">登录</button></p>
    </div>
    <script src="../js/getdelete.js"></script>
    <script>
        const user=document.querySelector('.user')
        const pwd=document.querySelector('.pwd')
        const regi=document.querySelector('.regi')
        const sign=document.querySelector('.sign')


        regi.addEventListener('click',function(){
            window.location.href='regi.html'
        })
        sign.addEventListener('click',function(){
            let userStr=user.value.trim()
            let pwdStr=pwd.value.trim()
            if(getCookie("user")===userStr&&getCookie("pwd")===pwdStr){
                setCookie("allow","yunxu",7)
                alert('登录成功点击确认弹跳页面')
                window.location.href='index.html'
            }else{
                alert('请输入正确的账号密码')
            }

        })
    </script>
</body>
</html>